package com.roadmap.client.module.user;

import java.util.List;

import org.apache.log4j.Logger;

import com.roadmap.client.module.BaseManager;
import com.roadmap.common.BaseEntity;
import com.roadmap.common.RdcLogger;
import com.roadmap.entities.Aspirant;
import com.roadmap.exception.ActionNotSupportedException;
import com.roadmap.exception.EntityNotFoundException;
import com.roadmap.exception.InvalidActionException;
import com.roadmap.exception.InvalidQueryException;
import com.roadmap.exception.InvalidStatusException;
import com.roadmap.exception.InvalidValueException;
import com.roadmap.exception.NullObjectException;
import com.roadmap.exception.ServerException;

public class AspirantManager extends BaseManager {
	private final static Logger logger = RdcLogger
			.getLogger(AspirantManager.class);

	public AspirantManager(String ownerId) {
		super(ownerId, Aspirant.class);
	}

	public AspirantManager(String ownerId, Aspirant parent) {
		super(ownerId, Aspirant.class, parent);
	}

	@Override
	public void create(BaseEntity entity) throws NullObjectException,
			InvalidActionException, InvalidValueException, ServerException,
			EntityNotFoundException, ActionNotSupportedException,
			InvalidStatusException {
		ActionNotSupportedException ane = new ActionNotSupportedException();
		logger.error("The mamanger doesn't support this action.");
		throw ane;
	}

	@Override
	public List<BaseEntity> getEntitiesOfParent() throws NullObjectException,
			InvalidQueryException, ServerException, InvalidValueException {
		return (List<BaseEntity>) getDbUtil().getEntitiesByCriteria(
				getManagedEntityType(), "1=1");
	}

}
